
from meta_service.frp import DefaultFrpProxy
from meta_service.frp import LinkToServerConfig,ProxyConfig,FrpConfig,DumpStr2TomlFile_FRPC,DumpStr2TomlFile_FRPS
from meta_service.frp import StartFrpc

# ========= 服务端 ============

frp = DefaultFrpProxy(
    "10.29.195.189",
    7001,
    7860, # LLM服务
    7002  # remote port
)

# frp.RunFrps()

# ========= 客户端 ============

sc = LinkToServerConfig(
    serverAddr="81.70.84.40",
    serverPort=7001
)
pc_ssh = ProxyConfig(
    name="ssh-tcp",
    type="tcp",
    localIP="127.0.0.1",
    # SCC本地的SSH服务
    localPort=22,
    # 远端端口
    remotePort=65022
)
pc_llm = ProxyConfig(
    name="llm-tcp",
    type="tcp",
    localIP="127.0.0.1",
    # SCC本地的LLM服务
    localPort=7002,
    # 远端端口
    remotePort=65002
)
content = str(sc) + str(pc_ssh) + str(pc_llm)

# 下面的两个函数需要同时使用
DumpStr2TomlFile_FRPC(content)
StartFrpc()


# or
# frp.RunFrps()
# frp.RunFrpc()

input("Press any key to exit...")


